package com.first.xiinn.service.impl;

import java.util.Date;
import java.util.List;

import com.first.core.service.impl.BaseServiceImpl;
import com.first.core.util.PagingBean;
import com.first.xiinn.dao.InMessageDao;
import com.first.xiinn.model.InMessage;
import com.first.xiinn.model.ShortMessage;
import com.first.xiinn.service.InMessageService;

public class InMessageServiceImpl extends BaseServiceImpl<InMessage>
  implements InMessageService
{
  private InMessageDao dao;

  public InMessageServiceImpl(InMessageDao dao)
  {
    super(dao);
    this.dao = dao;
  }

  public InMessage findByRead(String userId) {
    return this.dao.findByRead(userId);
  }

  public Integer findByReadFlag(String userId) {
    return this.dao.findByReadFlag(userId);
  }

  public List<InMessage> findAll(String userId, PagingBean pb) {
    return this.dao.findAll(userId, pb);
  }

  public List findByUser(String userId, PagingBean pb) {
    return this.dao.findByUser(userId, pb);
  }

  public List searchInMessage(String userId, InMessage inMessage, ShortMessage shortMessage, Date from, Date to, PagingBean pb)
  {
    return this.dao.searchInMessage(userId, inMessage, shortMessage, from, to, pb);
  }

  public InMessage findLatest(String userId) {
    return this.dao.findLatest(userId);
  }
}

